package com.szm.lnr.utils;

import android.content.Context;
import android.graphics.Point;
import android.view.WindowManager;

/**
 * Created by szm on 2018/7/27.
 */

public class DeviceUtil {

    /**
     * 测量屏幕实际宽高
     */
    public static int[] getScreenRealSize(Context context) {
        WindowManager windowManager = (WindowManager) context.getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
        Point point = new Point();
        windowManager.getDefaultDisplay().getRealSize(point);
        return new int[]{ point.x, point.y};
    }
}
